/*
day101
2019.12.7
*/
#include<string>
#include<iostream>
using namespace std;

struct TreeNode {
    int val;
    TreeNode *left;
    TreeNode *right;
    TreeNode(int x) : val(x), left(NULL), right(NULL) {}
};

class Solution {
public:
    string smallestFromLeaf(TreeNode* root) {
    	
    	if(!root) return "";
    	
    	
        string str_lef=smallestFromLeaf(root->left);
        string str_rig=smallestFromLeaf(root->right);
        
        
        char cur='a'+root->val;
        string str="";
        
        if(str_lef=="" && str_rig=="")
        {
        	str+=cur;
		}
		
		else if(str_lef=="" && str_rig!="")
        {
        	str+=str_rig;
		}
		
		else if(str_lef!="" && str_rig=="")
        {
        	
		}
		else if(str_lef!="" && str_rig!="")
        {
        	
		}
		
        
        
        if(str_lef<str_rig) return str_lef+cur;
        else return str_rig+cur;
    }
};

int main()
{
	string str="";
	char a='a'+1;
	str+=a;
	cout<<str<<endl;
	return 0;
}
